Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also add executables for pythonX.X under pypy #1615

Merged
merged 3 commits into from
Feb 14, 2020
Merged

Also add executables for pythonX.X under pypy #1615

merged 3 commits into from
Feb 14, 2020

Conversation

asottile
Copy link
Contributor

@asottile asottile commented Feb 13, 2020

Resolves #1612
Resolves #1614

Thanks for contributing a pull request, see checklist all is good!

  • wrote descriptive pull request text
  • added/updated test(s)
  • updated/extended the documentation
  • added news fragment in docs/changelog folder

@asottile
Copy link
Contributor Author

marking as draft as I think this is blocked by #1614

@asottile asottile marked this pull request as ready for review February 14, 2020 17:25
@asottile
Copy link
Contributor Author

ah neat, the remaining failures will be fixed by https://bitbucket.org/pypy/pypy/pull-requests/697/also-create-python3x-symlink-in/diff -- I'll add a little skip for that

Copy link
Contributor

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@asottile
Copy link
Contributor Author

macos py35 failure appears to be a flake -- I think this is ready to go

@gaborbernat gaborbernat merged commit 329c805 into pypa:master Feb 14, 2020
@asottile asottile deleted the pyxx branch February 15, 2020 18:57
exes = ("python", "python{}".format(*sys.version_info), "python{}.{}".format(*sys.version_info))
# pypy3<=7.3: https://bitbucket.org/pypy/pypy/pull-requests/697
if IS_PYPY and CURRENT.pypy_version_info[:3] <= [7, 3, 0] and creator == "venv":
exes = exes[:-1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this is correct. On CPython, the actual exe (what is at the base of all the symlinks) is python/path/python3.6, on PyPy it is pypy/path/pypy3. Then venv copies that base exe and creates aliases for newpath/bin/python and newpath/bin/python3. So the test should be something like

if IS_PYPY:
    exename = f'pypy{sys.version_info.major}'
else:
    exename = f'python{sys.version_info.major}.{sys.version_info.minor}'
exes = ("python", f'pypy{sys.version_info.major}', exename)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattip the fact that the base is python3.6 is just a matter of luck; of under what name we discover the python. It well could be any of the python, python3 or python3.6 depending on how we discover it on the path. How it's exposed at root level from should not affect how the virtualenv makes it available 👍

@mattip
Copy link
Contributor

mattip commented Feb 15, 2020

Here venv creates links for python and python3. Since it does not take into account python3.6, those are the only "blessed" names. There is no promise python3.6 is a valid name.

@gaborbernat
Copy link
Contributor

I consider that an implementation detail given the pep does not address it, so we might choose to offer further aliases if we want in our own implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

20.0.3: making a pypy2 virtualenv from pypy3 loses libpypy so Produce python#.# executables when using pypy
4 participants